import request from '@/utils/request'

/**
 * @description 获取行业列表
 * @returns {*}
 */
export function getIndustryListAPI() {
  return request({
    url: '/park/industry',
    method: 'GET'
  })
}

/**
 * @description: 获取企业列表
 * @param  params{{pageSize: number, page: number}}
 * @returns
 */
export function getEnterpriseListAPI(params) {
  return request({
    url: '/park/enterprise',
    method: 'GET',
    params
  })
}

/**
 * @description 新增企业
 * @param data
 */
export function addEnterpriseAPI(data) {
  return request({
    url: 'park/enterprise',
    method: 'POST',
    data: data
  })
}

/**
 * @description 查看企业
 * @param id
 * @returns {*}
 */
export function getEnterpriseByIdAPI(id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'GET'
  })
}

/**
 * @description 更新企业
 * @param data
 * @returns {*}
 */
export function updateEnterpriseAPI(data) {
  return request({
    url: `/park/enterprise`,
    method: 'PUT',
    data
  })
}
/**
 * @description 删除企业
 * @param id
 * @returns {*}
 */
export function deleteEnterpriseAPI(id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'DELETE'
  })
}

/**
 * @description 获取楼宇列表
 * @returns {*}
 */
export function getRentBuildListAPI() {
  return request({
    url: `/park/rent/building`
  })
}

/**
 * @description 创建合同
 * @param data
 * @return {*}
 */
export function createRentAPI(data) {
  return request({
    url: '/park/enterprise/rent',
    method: 'POST',
    data
  })
}

/**
 * @description 获取合同列表
 * @param id
 * @return {*}
 */
export function getRentListAPI(id) {
  return request({
    url: `/park/enterprise/rent/${id}`,
    method: 'GET'
  })
}

/**
 * @description 退租租赁合同
 * @param rentId
 * @return {*}
 */
export function outRentAPI(rentId) {
  return request({
    url: `/park/enterprise/rent/${rentId}`,
    method: 'PUT'
  })
}

/**
 * @description 删除租赁合同
 * @param rentId
 * @return {*}
 */
export function deleteRentAPI(rentId) {
  return request({
    url: `/park/enterprise/rent/${rentId}`,
    method: 'DELETE'
  })
}
/**
 * @description 获取企业详情
 * @param id
 * @return {*}
 */
export function getEnterpriseDetail(id) {
  return request({
    url: `/park/enterprise/${id}`,
    method: 'GET'
  })
}
